package cn.tedu.boot03_1.mapper;

import cn.tedu.boot03_1.entity.Product_1;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Product_1Mapper {
    @Insert("INSERT INTO product_1 VALUES(NULL,#{title},#{price},#{num})")
    int insert(Product_1 product_1);

    @Select("SELECT * FROM product_1")
    List<Product_1> select();

    @Update("UPDATE product_1 SET title=#{title},price=#{price},num=#{num} WHERE id=#{id}")
    int update(Product_1 product_1);

    @Delete("DELETE FROM product_1 WHERE id=#{id}")
    int deleteById(int id);

}
